package designMode.compositePattern;

/**
 * @author LIBOFEI
 * @ClassName Test
 * @description 组合模式测试
 * @date 2020/6/28 14:17
 * @Version 1.0
 **/
public class Test {

    public static void main(String[] args) {
        MenuComponent pancakeHouseMenu = new Menu("煎饼菜单","早餐");
        MenuComponent dinnerMenu = new Menu("牛排菜单","晚餐");
        MenuComponent cafeMenu = new Menu("咖啡菜单","下午茶");
        MenuComponent dessertMenu = new Menu("默认咖啡菜单","Cafe_default");

        MenuComponent allMenu = new Menu("全部菜单","All Menus");
        allMenu.add(pancakeHouseMenu);
        allMenu.add(dinnerMenu);
        allMenu.add(dessertMenu);

        pancakeHouseMenu.add(new MenuItem("1号煎饼","好吃的很",true,10.99));
        cafeMenu.add(dessertMenu);

        Print print = new Print(allMenu);
        print.printMenu();
        System.out.println("***************************************");
        print.printMenuByIterator();
    }
}
